<?php

class SeoService extends AbstractService
{

    protected function _init()
    {
	$this->setMapper(new SeoMapper());
    }

    public function getByControllerAndAction($controller, $action)
    {
	if (!$controller || !$action) {
	    return false;
	}

	$cacheSlot = new CacheSlotsSeoList(array($controller, $action));
	if (($model = $cacheSlot->load()) === false) {
	    $model = $this->getMapper()->getBy('controller = :controller AND action = :action', array(
		':controller' => $controller,
		':action' => $action
		    ));
	    $cacheSlot->setData($model)->save();
	}
	return $model;
    }

}

?>
